class ForumMessage {
  final int? id;
  final String content;
  final String publishDate;
  final int userId;
  final String username; // Store username for easier display

  ForumMessage({
    this.id,
    required this.content,
    required this.publishDate,
    required this.userId,
    required this.username,
  });

  factory ForumMessage.fromMap(Map<String, dynamic> map) {
    return ForumMessage(
      id: map['id'],
      content: map['content'],
      publishDate: map['publishDate'],
      userId: map['userId'],
      username: map['username'],
    );
  }

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'content': content,
      'publishDate': publishDate,
      'userId': userId,
      'username': username,
    };
  }
}
